#pragma once


// COpenFileDlg

class COpenFileDlg : public CFileDialog
{
	DECLARE_DYNAMIC(COpenFileDlg)

public:
	COpenFileDlg(LPCTSTR lpszFilter,
		const CStringArray& aStrMask,
		CWnd* pParentWnd = NULL,
		LPCTSTR lpszFileName = NULL,
		LPCTSTR lpszDefExt = NULL,
		DWORD dwFlags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST|OFN_HIDEREADONLY |
		OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY|OFN_NOVALIDATE,
		BOOL bOpenFileDialog = TRUE // TRUE for FileOpen, FALSE for FileSaveAs
		);
	virtual ~COpenFileDlg();

protected:
	static bool m_fAllowDirSelection;
	static WNDPROC m_wndProc;
	static LRESULT CALLBACK WindowProcNew(HWND hwnd,UINT message, WPARAM wParam, LPARAM lParam);

	virtual BOOL OnInitDialog();
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	virtual BOOL OnIncludeItem(OFNOTIFYEX* pOFNEx, LRESULT* pResult);

	DECLARE_MESSAGE_MAP()
	afx_msg void OnDestroy();

private:
	CAutoVectorPtr<TCHAR>			m_buff;
	const CStringArray&	m_asMask;

};


